package com.woniuxy.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.woniuxy.dao.StorageMapper;
import com.woniuxy.pojo.Storage;
import com.woniuxy.service.StorageService;
import com.woniuxy.util.DataGridView;
import com.woniuxy.vo.StorageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StorageServiceImpl implements StorageService {
    @Autowired
    private StorageMapper storageMapper;
    @Override
    public DataGridView selectCondition(StorageVo storageVo) {
        Page<Object> page=PageHelper.startPage(storageVo.getPage(),storageVo.getLimit());
        List<Storage> storages=storageMapper.selectCondition(storageVo);
        return new DataGridView(page.getTotal(),storages);
    }
}
